/**
 * <p>Title: Data Capture System</p>
 * <p>Description: 外汇交易系统数据捕获接收系统</p>
 * <p>Copyright: Copyright (c) 2005 Intenation Geong</p>
 * <p>Company: Geong</p>
 */
package com.sxds.wn.service.web;

import java.util.List;

import org.springframework.beans.factory.DisposableBean;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.core.io.Resource;

import com.sxds.wn.exception.DataAccessException;
import com.sxds.wn.exception.ParameterException;
import com.sxds.wn.service.BaseService;
import com.sxds.wn.service.IService;
import com.sxds.wn.util.XmlUtil;

/**
 * Description: <p>业务报表服务类</p>
 * Content Desc:<p>业务报表服务类<p>
 * Copy Right of Geong
 * @author Tangtao Email:<a href="mailto:tangtao7481@yahoo.com.cn">tangtao7481@yahoo.com.cn</a>
 * @version 1.0 Create Date:@2010-4-22
 */
public class BizTreeService extends BaseService implements IService,InitializingBean, DisposableBean {

	private Resource cateringTaxationResouce;
	private List cateringTaxation;
	private Resource queryStaticResource;
	private List queryStatic;
	private Resource systemMaintainResource;
	private List systemMaintain;
	

	public void afterPropertiesSet() throws Exception {
		this.cateringTaxation = XmlUtil.parseXmlToTreeNode(cateringTaxationResouce);
		this.queryStatic = XmlUtil.parseXmlToTreeNode(queryStaticResource);
		this.systemMaintain = XmlUtil.parseXmlToTreeNode(systemMaintainResource);
	}

	public void destroy() throws Exception {
		if( cateringTaxation!=null ) {
			cateringTaxation.clear();
			cateringTaxation = null;
		}
		if( queryStatic!=null ){
			queryStatic.clear();
			queryStatic = null;
		}
		if( systemMaintain!=null ){
			systemMaintain.clear();
			systemMaintain = null;
		}
	}
	
	/* (non-Javadoc)
	 * @see com.cfets.dcs.service.BaseService#checkPermission()
	 */
	@Override
	protected boolean checkPermission() throws SecurityException {
		return false;
	}

	/**
	 * 餐饮业定税
	 * @throws ParameterException
	 */
	public void getCateringSetTax() throws DataAccessException {
		//把结果写入的返回对象中
		this.response.setOk(true);
		this.response.getPageAttributes().put("list", cateringTaxation);
	}
	
	/**
	 * 查询统计
	 * @throws ParameterException
	 */
	public void getQueryStatic() throws DataAccessException {
		//把结果写入的返回对象中
		this.response.setOk(true);
		this.response.getPageAttributes().put("list", queryStatic);
	}
	
	/**
	 * 系统维护
	 * @throws ParameterException
	 */
	public void getSystemMaintain() throws DataAccessException {
		//把结果写入的返回对象中
		this.response.setOk(true);
		this.response.getPageAttributes().put("list", systemMaintain);
	}
	
	/* (non-Javadoc)
	 * @see com.cfets.dcs.service.BaseService#validateParameters()
	 */
	@Override
	protected boolean validateParameters() throws ParameterException {
		return false;
	}

	/**
	 * @return the cateringTaxationResouce
	 */
	public Resource getCateringTaxationResouce() {
		return cateringTaxationResouce;
	}

	/**
	 * @param cateringTaxationResouce the cateringTaxationResouce to set
	 */
	public void setCateringTaxationResouce(Resource cateringTaxationResouce) {
		this.cateringTaxationResouce = cateringTaxationResouce;
	}

	public Resource getQueryStaticResource() {
		return queryStaticResource;
	}

	public void setQueryStaticResource(Resource queryStaticResource) {
		this.queryStaticResource = queryStaticResource;
	}

	public Resource getSystemMaintainResource() {
		return systemMaintainResource;
	}

	public void setSystemMaintainResource(Resource systemMaintainResource) {
		this.systemMaintainResource = systemMaintainResource;
	}
	
}
